<template>
  <el-card>
    <template v-slot:header>
      <div class="clearfix">
        <span>{{ i18n('user.center.title') }}</span>
      </div>
    </template>
    <div class="user-profile">
      <div class="box-center">
        <el-avatar :size="100" :src="user.userinfo.avatar">
          <img src="@/assets/images/default/circle.png" />
        </el-avatar>
      </div>
      <div class="box-center">
        <div class="user-name text-center">{{ user.userinfo.nickname }}</div>
        <div class="user-role text-center text-muted">
        </div>
      </div>
    </div>
    <div class="user-bio">
      <div class="user-education user-bio-section">
        <div class="user-bio-section-header">
          <el-icon class="el-icon-tickets" /><span>{{
            i18n('user.center.description')
          }}</span>
        </div>
        <div class="user-bio-section-body">
          <div class="text-muted">
            <p>
              <el-icon class="el-icon-mobile-phone" />
              {{ i18n('user.mobile') }}：{{ user.userinfo.mobile }}
            </p>
            <p>
              <el-icon class="el-icon-message" />
              {{ i18n('user.email') }}：{{ user.userinfo.email }}
            </p>
          </div>
        </div>
      </div>
    </div>
  </el-card>
</template>

<script setup name="userinfo">
  import { useBase } from "@/hooks/base/useBase";
  import { useStore } from "@/hooks/store/useStore";

  const { i18n } = useBase()
  const { user } = useStore()
</script>

<style lang="scss" scoped>
.box-center {
  margin: 0 auto;
  display: table;
}
.text-muted {
  color: #777;
  p {
    margin: 10px 0;
  }
}
.user-profile {
  .user-name {
    font-weight: bold;
  }

  .box-center {
    padding-top: 10px;
    text-align: center;
  }

  .user-role {
    padding-top: 10px;
    font-weight: 400;
    font-size: 14px;
  }

  .box-social {
    padding-top: 30px;

    .el-table {
      border-top: 1px solid #dfe6ec;
    }
  }

  .user-follow {
    padding-top: 20px;
  }
}
.user-bio {
  margin-top: 20px;
  color: #606266;
  span {
    padding-left: 4px;
  }
  .logo-wrapper {
    display: inline-block;
    margin: 10px 0;
    img {
      width: 1.4rem;
      display: inline-block;
      margin: 0 0.6rem;
      cursor: pointer;
      &.unbind {
        -webkit-filter: grayscale(100%);
        -moz-filter: grayscale(100%);
        -o-filter: grayscale(100%);
        filter: grayscale(100%);
      }
      &.radius {
        border-radius: 50%;
      }
    }
  }
  .user-bio-section {
    font-size: 14px;
    padding: 15px 0;

    .user-bio-section-header {
      border-bottom: 1px solid #dfe6ec;
      padding-bottom: 10px;
      margin-bottom: 10px;
      font-weight: bold;
    }
  }
}
</style>
